module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const WxpublickSchema = new Schema({
    ownerWxid: { type: String, required: true, index: true },
    wxid: { type: String, required: true, unique: true },
    wxNum: { type: String },
    nick: { type: String },
    v3: { type: String}, // v3
    avatarMinUrl: { type: String}, 
    avatarMaxUrl: { type: String}, 
    issave: { type: Boolean, default: false },
    isauto: { type: Boolean, default: false },
  }, {
    timestamps: { createdAt: 'createTime', updatedAt: 'updateTime' }
  });

  WxpublickSchema.index({ wxid: 1, ownerWxid: 1 });

  return mongoose.model('Wxpublick', WxpublickSchema);
};
